#include "multiplexer.h"

void setMultiplexer(char i)
{
  char a=(i&B0000001);        // calculate LSB   
  char b=(i&B0000010)>>1;     // calculate middle bit  
  char c=(i&B0000100)>>2;     // calculate MSB   
  digitalWrite(6,c);        // write MSB  
  digitalWrite(5,b);        // write middle bit  
  digitalWrite(4,a);         // write LSB      
}  

void initialiseMultiplexer (void)
{
  pinMode(6,OUTPUT);   // declare pins to set multiplexer
  pinMode(5,OUTPUT);  
  pinMode(4,OUTPUT); 
}

